<#assign ctx=request.contextPath />
<#macro abbr target name>
<input type="text" class="layui-input" name="${name}"
				placeholder="" autocomplete="off">
<script type="text/javascript">
	layui.use('jquery',function(){
		var $ = layui.$;
	    var inputDelay;
	    $("input[name='${target}']").bind('input',function(){
			clearTimeout(inputDelay);
			inputDelay = setTimeout(function(){
			    var uname = $("input[name='${target}']").val();
			    $.get("${ctx}/s/py_abbr",{data:uname},function(data){
					$("input[name='${name}']").val(data);
			    });
			},500);
		});
	})

</script>
</#macro>